package Practice7_XML.P2_SAX;

import Utils.io.IOUtils;
import org.junit.jupiter.api.Test;
import org.xml.sax.SAXException;

import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import java.io.IOException;
import java.io.InputStream;

public class P1 {
    @Test
    public void test01() throws IOException, ParserConfigurationException, SAXException {
        InputStream is = IOUtils.file2InputStream("src/test/resources/test.xml");
        SAXParserFactory spf = SAXParserFactory.newInstance();
        SAXParser sp = spf.newSAXParser();
        sp.parse(is,new MyHandler());
    }
}
